package com.example.r2022913.controller.WxController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.r2022913.common.ApiRestResponse;
import com.example.r2022913.model.entity.WxEntity.MessageEntity;
import com.example.r2022913.service.WxService.MessageService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("wx/message")
@Api(tags = "wx小程序服务  MessageController")
@CrossOrigin
@Slf4j
public class MessageController {
    @Autowired
    MessageService messageService;
    @GetMapping("/page")
    public ApiRestResponse messageList(@RequestParam Integer pages, @RequestParam Integer rows){
        IPage page = messageService.studentIpage(pages, rows);
        List<MessageEntity> messageEntityList = page.getRecords();
        return ApiRestResponse.success(messageEntityList);
    }
}
